function Parent(id, name) {
  this.id = id;
  this.name = name;
}

function newFun(...rest) {
  var obj = {};
  var result = Parent.call(obj, ...rest);
  obj.__proto__ = Parent.prototype;
  return typeof result == 'object' ? result : obj;
}

var a = newFun(1, 'louzb')